<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
//     function getrobert(n){
//    if(n == 1 || n == 2){
//       return 1;
//       }
//    return f(n-1)+f(n-2);
//  };
//  console.log(`共有${getrobert(12)}对兔子`);
 function f(n , ac1 = 1 , ac2 = 1) {
  if( n == 1 || n ==2 ) {
    return ac2
  };

  return f(n - 1, ac2, ac1 + ac2);
}
console.log(`共有${f(12)}对兔子`);
</script>